import Layout from "@/views/Layout.vue"

const routes = [

  {
    path: '/home',
    name: 'home',
    component: Layout,
    meta: {
      path: '/home',
      title: '首页',
    }
  },
  {
    path: '/admin',
    name: 'admin',
    component: Layout,
    meta: {
      path: '/admin',
      title: '管理员管理'
    },
    children: [
      {
        path: '/admin/adminlist',
        meta: {
          path: '/admin/adminlist',
          title: '管理员列表'
        },
        component: () => import('@/views/admin/Index.vue'),
      },
    ],
  },
  {
    path: '/member',
    name: 'member',
    component: Layout,
    meta: {
      path: '/member',
      title: '会员管理'
    },
    children: [
      {
        path: '/member/memberlist',
        meta: {
          path: '/member/memberlist',
          title: '会员列表'
        },
        component: () => import('@/views/member/Index.vue'),
      },
    ],
  },
  {
    path: '/charge',
    name: 'charge',
    component: Layout,
    meta: {
      path: '/charge',
      title: '车辆出入收费管理'
    },
    children: [
      {
        path: '/charge/chargelist',
        meta: {
          path: '/charge/chargelist',
          title: '车辆进出场登记'
        },
        component: () => import('@/views/charge/Index.vue'),
      },
      {
        path: '/charge/chargesearch',
        meta: {
          path: '/charge/chargesearch',
          title: '车辆进出场查询'
        },
        component: () => import('@/views/charge/Search.vue'),
      },
    ],
  },
  {
    path: '/parksetting',
    name: 'parksetting',
    component: Layout,
    meta: {
      path: '/parksetting',
      title: '停车场管理'
    },
    children: [
      {
        path: '/parksetting/parksettinglist',
        meta: {
          path: '/parksetting/parksettinglist',
          title: '停车场列表'
        },
        component: () => import('@/views/parksetting/Index.vue'),
      },
    ],
  },

]

export function getMenus() {

  let menus: any = [];
  menus = JSON.parse(JSON.stringify(routes));
  // menus.forEach((item:any)=>{
  //   console.log('item',item);
    
  // })
  
  return menus;
}
export default routes;